# +----------------------------------------------------------------------
# | Pink [ A modern python web framework ]
# +----------------------------------------------------------------------
# | Copyright (c) 2023 http:#unnnnn.com All rights reserved.
# +----------------------------------------------------------------------
# | Author: chenjianhua <unnnnn@foxmail.com>
# +----------------------------------------------------------------------

from .. import Middleware


class ClearDumpsBetweenRequestsMiddleware(Middleware):
    """Clear dumps between each requests to avoid showing too much data."""

    def before(self, request, response):
        request.app.make("dumper").clear()
        return request

    def after(self, request, response):
        return request
